﻿using System;
using System.Collections.Generic;
using System.Web.UI.WebControls;
using BLL.RF.ATETest;
using Model.RF.ATETest;

public partial class ViewbyProduct_ViewUploadZTEData_UploadZTEDataViewbyDT : System.Web.UI.Page
{
    private IList<tb_result_DFL_Info> list;

    private DateTime dt1
    {
        get { return DateTime.Parse(ViewState["dt1"].ToString()); }
        set { ViewState["dt1"] = value; }
    }
    private DateTime dt2
    {
        get { return DateTime.Parse(ViewState["dt2"].ToString()); }
        set { ViewState["dt2"] = value; }
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        GridView1.Attributes.Add("style", "word-break:break-all;word-wrap:break-word");
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        dt1 = DateTime.Parse(this.TextBox1.Value.Trim());
        dt2 = DateTime.Parse(this.TextBox2.Value.Trim());
        BindData();
    }

    private void BindData()
    {
        tb_result_DFL test = new tb_result_DFL();
        list = test.tb_result_DFL_GetbyDT(dt1, dt2);
        GridView1.DataSource = list;
        GridView1.DataBind();
        //for (int i = 0; i < GridView1.Rows.Count; i++)
        //{
        //    if (GridView1.Rows[i].Cells[6].Text == "失败")
        //        GridView1.Rows[i].Cells[6].ForeColor = System.Drawing.Color.Red;
        //}
    }

    protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        this.GridView1.PageIndex = e.NewPageIndex;
        BindData();
    }
}
